<?php
global $_W,$_GPC;
$title = '取消支付';
WXLimit();
$id = $_GPC['id'];
$weid = $_W['uniacid'];
$mem = $this->getMem();
$order = get('select * from '.tb('order')." where id='{$id}' and mid='{$mem['id']}' and uniacid='{$weid}'");
if (empty($order)){
	MSG('访问错误');
}
if ($order['status']){
	MSG('该订单已支付成功');
}
$book = get('select * from '.tb('book')." where id='{$order['bid']}'");
$time = 900 - (time() - $order['createtime']);
$time = max(0,$time);

$cfg = $this->module['config'];
$cph = $cfg['cpurchase'];
$share = $this->getShare($mem, $cfg);
include $this->template('payfail');